# $Id$
# Maintainer:Antonio Rojas <arojas@archlinux.org>

pkgname=kwallet-pam
pkgver=5.10.95
pkgrel=1
pkgdesc='KWallet PAM integration'
arch=(i686 x86_64)
url='https://www.kde.org/workspaces/plasmadesktop/'
license=(LGPL)
depends=(pam libgcrypt socat)
makedepends=(extra-cmake-modules qt5-base)
groups=(plasma)
source=("https://download.kde.org/unstable/plasma/$pkgver/$pkgname-$pkgver.tar.xz"{,.sig})
sha256sums=('d715b88be84387edc2421655267451d76a624f8b67b04fb7a2ac19e157d2cf56'
            'SKIP')
validpgpkeys=('2D1D5B0588357787DE9EE225EC94D18F7F05997E'  # Jonathan Riddell
              '348C8651206633FD983A8FC4DEACEA00075E1D76'  # KDE Neon
              'D07BD8662C56CB291B316EB2F5675605C74E02CF') # David Edmundson

prepare() {
  mkdir -p build{,4}
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_LIBEXECDIR=lib
  make

  cd ../build4
  cmake ../$pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_LIBEXECDIR=lib \
    -DKWALLET4=1
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
  cd ../build4
  make DESTDIR="$pkgdir" install
}
